package com.kly.springbootinit.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.kly.springbootinit.model.dto.Clazz.ClazzQueryRequest;
import com.kly.springbootinit.model.entity.Clazz;
import com.kly.springbootinit.model.vo.ClazzVO;

import javax.servlet.http.HttpServletRequest;

/**
 * 班级服务
 *
 * @author <a href="https://github.com/likly">程序员鹿七</a>
 * @from <a href="https://www.code-nav.cn">编程导航学习圈</a>
 */
public interface ClazzService extends IService<Clazz> {

    /**
     * 校验数据
     *
     * @param Clazz
     * @param add 对创建的数据进行校验
     */
    void validClazz(Clazz Clazz, boolean add);

    /**
     * 获取查询条件
     *
     * @param ClazzQueryRequest
     * @return
     */
    QueryWrapper<Clazz> getQueryWrapper(ClazzQueryRequest ClazzQueryRequest);
    
    /**
     * 获取班级封装
     *
     * @param Clazz
     * @param request
     * @return
     */
    ClazzVO getClazzVO(Clazz Clazz, HttpServletRequest request);

    /**
     * 分页获取班级封装
     *
     * @param ClazzPage
     * @param request
     * @return
     */
    Page<ClazzVO> getClazzVOPage(Page<Clazz> ClazzPage, HttpServletRequest request);
}
